<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<html>
<head>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script>
    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script src="/static/js/case.js"></script>
    <script src="/static/js/allcode.js"></script>
    <title>用例列表</title>
</head>
<body>
<div>
    <c:import url="casenavit.jsp" charEncoding="UTF-8"/>
    <div class="col-sm-3 col-md-8 sidebar">
        <div class="table-responsive">
            <table class="table table-striped">
                <thead>
                <tr>
                    <th style="text-align:center">id</th>
                    <th style="text-align:center">名称</th>
                    <th style="text-align:center">简介</th>
                    <th style="text-align:center">包含接口数</th>
                    <th style="text-align:center">创建时间</th>
                    <th style="text-align:center">操作</th>
                </tr>
                </thead>
                <tbody>
                <c:forEach items="${caselists}" var="caselist">
                    <tr>
                        <td style="text-align:center">${caselist.caseid}</td>
                        <td style="text-align:center;width:180px; height:51px; word-wrap:break-word; word-break:break-all">
                            <a href="/case/caseinfo?caseid=${caselist.caseid}">${caselist.casename}</a>
                        </td>
                        <td style="text-align:center;width:180px; height:51px; word-wrap:break-word; word-break:break-all">${caselist.caseinfo}</td>
                        <td style="text-align:center">${caselist.intercount}</td>
                        <fmt:formatDate type="both" value="${caselist.createtime}" var="createtime" />
                        <td style="text-align:center">${createtime}</td>
                        <td style="text-align:center">
                            <div class="btn-group" role="group" aria-label="...">
                                <button type="button" class="btn btn-default" onclick="getcaseinfo(${caselist.caseid})">编辑</button>
                                <button type="button" class="btn btn-default" onclick="delcasemodel(${caselist.caseid})">删除</button>
                            </div>
                        </td>
                    </tr>
                </c:forEach>
                </tbody>
            </table>
        </div>
    </div>
    <div>
        <button class="btn btn-default" type="submit" onclick="addclearcaseinfo()">新建用例</button>
    </div>
</div>

<!-- 模态框（Modal） -->
<div class="modal fade" id="addcaseinfomodel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <h5 style="display: none" id="caseidinfo"></h5>
                <div class="input-group">
                    <span class="input-group-addon">项目ID:</span>
                    <input id="caseprojectid" disabled="true" value="${projectid}" type="text" class="form-control">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">用例标题:</span>
                    <input id="newcasename" type="text" class="form-control" placeholder="请输入用例标题">
                </div>
                <br>
                <div class="input-group">
                    <span class="input-group-addon">用例描述:</span>
                    <textarea id="newcaseinfo" class="form-control" rows="3"></textarea>
                </div>
            </div>
            <div class="modal-footer">
                <h5 id="casemessage"></h5>
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onclick="goaddupcaseinfo()">提交</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>


<div class="modal fade" id="messagecaseinfomodel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-body">
                <h5 id="messagecaseinfoid"></h5>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

<div>
    <div class="modal fade" id="messagemodel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-body">
                    <h5 id="httpmessageid"></h5>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal -->
    </div>
</div>

<div class="modal fade" id="delinterinfoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <h5 id="delcaseidmodel" style="display: none"></h5>
            <div class="modal-body">
                是否确定删除
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                </button>
                <button type="button" class="btn btn-primary" onclick="delcaseinfo()">确定</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>

</body>
</html>